home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr31
/
pkansi.zip
/
PKANSI.DOC
< prev
next >
Wrap
Text File
|
1993-04-01
|
17KB
|
392 lines
PKANSI.ZIP - Uploaded to EXEC-PC 2/93 by Mark "Pinky" Schulz
This zipfile contains:
1. PKANSI.DOC - Tutorial on implementing ANSI escape sequences and
RAM disks.
2. PKEY.TXT - ANSI escape codes for adding "PKZIP/UNZIP" key commands.
3. CONFIG.MS4 - Example MS-DOS 4.01 CONFIG.SYS file
4. CONFIG.MS5 - Example MS-DOS 5.00 CONFIG.SYS file
5. CONFIG.DR6 - Example DR-DOS 6.00 CONFIG.SYS file
6. AUTOEXEC.BAT - Example AUTOEXEC.BAT file
7. DATACOM.BAT - Example SET-UP/UNZIP/START batch file.
Are you feeling too emcumbered by the over-involved menus with "PK"
commands? Perhaps you're typing "pkunzip..." too often at the
command prompt? Is your hard disk light constantly lit? Do you
think it's time to upgrade? This little DOS refresher should jar loose
some cobwebs about the use of ANSI escape sequences which redefine keys
as well as how to get better use of all that extra RAM you paid for when
you bought your computer.
A "PKUNZIP..." command will now be a keystroke away.
This is especially handy if your files are stored as .zip's on your disk
and unzipped into a RAM disk for use. This eliminates some worry over
viruses, as well as saving disk space. Your DOS probably has a RAM disk
included as an installable device driver. Only 4 MEG RAM extension is
required for most non-windows applications. Many will get by with as
little as 1 MEG. The viruses are then contained in the RAM disk and get
no access to the contents of your storage drive. When the computer is
turned off, the contents of the RAM disk (along with any viruses)
disappear from the system. Extra care must be taken to ZIP any files
generated during the session to the storage drive using the keystroke
commands. More details on the use of RAM disks can be found at the end
of this file. Now, let's discuss keystroke commands...
Make sure the ANSI.SYS file is present in the DOS directory of your boot
drive. To use ANSI escape sequences, you must first add the following
lines to your CONFIG.SYS and AUTOEXEC.BAT file prior to rebooting:
CONFIG.SYS:
DEVICE=C:\DOS\ANSI.SYS
Copy the PKEY.TXT file to the root directory of your boot drive
and add the following line near the end of your AUTOEXEC.BAT:
TYPE C:\PKEY.TXT
There are example CONFIG.SYS and AUTOEXEC.BAT files included which
can serve as a good starting point for constructing your boot files.
Refer to the RAM DISK section of this text.
WARNING:
Please note that "typing" THIS file at the command prompt after ANSI.SYS
is installed will result in the redefinition of the "F" keys per the
sequences at the end of this section. Use an ASCII file viewer or text
editor to read any files containing ANSI escape sequences. Using the DOS
TYPE command at the command prompt will result in the execution of the
sequences.
If you opt to use the PKEY.TXT file "as is", after rebooting, the
following keystrokes at the command prompt will automatically type
in these commands:
KEYSTROKE COMMAND
CTRL-F1 PKUNZIP (followed by a SPACE)
CTRL-F2 PKZIP -EX (followed by a SPACE)
CTRL-F3 PKUNZIP -D (followed by a SPACE)
CTRL-F4 PKZIP -RPEX (followed by a SPACE)
CTRL-F5 DIR A:\*.ZIP/P (followed by a RETURN)
CTRL-F6 DIR B:\*.ZIP/P (followed by a RETURN)
CTRL-F7 DIR C:\*.ZIP/P (followed by a RETURN)
CTRL-F8 DIR D:\*.ZIP/P (followed by a RETURN)
The commands followed by a SPACE allow further entry before the manual
RETURN is entered. The commands followed by the RETURN character are
automatically typed and entered.
**********************************************************************
Now that the "quick start" is out of the way, what exactly is an ANSI
escape sequence?
An ANSI escape sequence is a series of characters (beginning with an
escape character or keystroke) developed by the American National
Standards Institute. These sequences are used to define functions for
DOS. Specifically, you can change graphics functions (i.e., the ANSI
screen mode when logging on to the BBS), redefine keys, etc.
What follows will discuss the ANSI escape sequence as it relates to
redefining keys. To get more information on other ANSI functions, refer
to the installable device driver section of your DOS documentation.
The general form of the ANSI escape sequence is:
1. A one-byte "ESC" character (hexadecimal 1BH).
2. A one-byte "[" character (hexadecimal 5BH).
3. One or more decimal numbers separated by semicolons.
When assigning keys, you can use extended character codes by typing
the first variable in the sequence as 0 (NUL) followed by the second
key. (i.e., 0;68; is the F10 key) Refer to the table below.
Once the key is identified, any following characters contained in
quotation marks redefine the key.
4. A single command character which defines the type of ANSI function.
To redefine a key, this character is "p".
Extended Character Code Table (0;xxx;)
KEY ALONE +SHIFT +CTRL +ALT
F1 59 84 94 104
F2 60 85 95 105
F3 61 86 96 106
F4 62 87 97 107
F5 63 88 98 108
F6 64 89 99 109
F7 65 90 100 110
F8 66 91 101 111
F9 67 92 102 112
F10 68 93 103 113
The PKEY.TXT file included in this .zip works as outlined above after
the ANSI.SYS is installed. You can modify or add keys and functions
to your personal preferences using a text editor which allows entering
control characters into the text. If your editor does not have this
feature, chances are it will allow you to copy lines and edit only
those characters which will change the key or function. Please note
the first two characters of each command are always the same and are
necessary to complete a valid ANSI escape sequence. You can use the
PKEY.TXT file as the source for your editing endeavors, provided you
do not attempt to alter the first two characters of each command.
Also note a valid key redefinition must always end with a "p".
EXAMPLE:
The PKEY.TXT file as zipped reads:
TEXT IN FILE MEANING
4;"pkunzip";32p CTRL-F1 = PKUNZIP + SPACE
5;"pkzip -ex";32p CTRL-F2 = PKZIP -EX + SPACE
6;"pkunzip -d";32p CTRL-F3 = PKUNZIP -D + SPACE
7;"pkzip -rpex";32p CTRL-F4 = PKZIP -RPEX + SPACE
8;"dir a:\*.zip/p";13p CTRL-F5 = DIR A:\*.ZIP/P + RETURN
9;"dir b:\*.zip/p";13p CTRL-F6 = DIR B:\*.ZIP/P + RETURN
00;"dir c:\*.zip/p";13p CTRL-F7 = DIR C:\*.ZIP/P + RETURN
01;"dir d:\*.zip/p";13p CTRL-F8 = DIR D:\*.ZIP/P + RETURN
You want the directory command for drive C: to become C:\ZIP.
You want the SHIFT-Fxx keystrokes to do your commands.
You don't have a drive D:
To change the drive C: directory command, edit line 7 of PKEY.TXT to:
00;"dir c:\zip\*.zip/p";13p
To change the keys to be redefined, change the 94-101 entries to 84-90:
(Line 8 has been deleted to eliminate the drive D: directory command.)
TEXT IN FILE MEANING
4;"pkunzip";32p SHIFT-F1 = PKUNZIP + SPACE
5;"pkzip -ex";32p SHIFT-F2 = PKZIP -EX + SPACE
6;"pkunzip -d";32p SHIFT-F3 = PKUNZIP -D + SPACE
7;"pkzip -rpex";32p SHIFT-F4 = PKZIP -RPEX + SPACE
8;"dir a:\*.zip/p";13p SHIFT-F5 = DIR A:\*.ZIP/P + RET
9;"dir b:\*.zip/p";13p SHIFT-F6 = DIR B:\*.ZIP/P + RET
0;"dir c:\zip\*.zip/p";13p SHIFT-F7 = DIR C:\ZIP\*.ZIP/P + RET
Some programs may disable or overwrite pending reassignments upon their
execution. To reinstate your original definitions, type this command
at the command prompt:
TYPE PKEY.TXT
----------------------------------------------------------------------
MORE ON RAM DISKS...
The extemded RAM in your computer is often idle amd unused if no
steps are taken to include it at boot up. Some programs look for
RAM controlled by the EMM386.SYS or HIMEM.SYS. If it is not found,
the extended or expanded RAM simply isn't used, and the program
defaults back to setting up virtual memory on your hard disk.
If the program is larger than system RAM, the computer must also
read the hard disk each time a new function or command is executed.
This not only slows the computer, but inflicts unnecessary wear and
tear on your hard drive. Watch to see how many times the hard disk
indicator light flashes in the course of executing a program.
Whenever that light is lit, the hard disk is operating.
The mechanical drives are well suited for data storage, but fall
far short in performance as "working drives" compared to the speed
of a RAM disk. What can be misconstrued as a poorly performing
computer is probably a poorly configured computer.
When a RAM disk is set-up in your system, the computer "sees" it as
just another drive. Functionally, it is no different from your
floppies or hard drive... the only difference being the contents of
the RAM disk are temporary and stay intact only as long as the
computer is on. The speed factor, however, is 20 to 50 times
faster than the floppies or hard drive.
****************************************************************
Where do you get the software for installing a RAM disk?
Look no further than the DOS you have.
MS-DOS 4.01 has a RAMDRIVE.SYS which requires no EMM or HIMEM.
MS-DOS 5.00 has a RAMDRIVE.SYS which requires EMM386.EXE.
DR-DOS 6.00 has a VDISK.SYS which requires no EMM, but "looks"
for a string in the CONFIG.SYS file and can be used with
MS-DOS 4.01 and 5.00.
****************************************************************
How do you install a RAM disk?
First, you must determine how much extended RAM is installed on
your computer. This can be seen at the boot-up screen.
Another method is to run a MEM command at the command prompt.
If extended memory is present, the MEM command will display the
number of bytes installed. Divide this number by 1024 to
determine the "K" value. (i.e., 7424K = 7602176 bytes)
Use the larger number to do this calculation; it reflects the
number of bytes present at boot-up.
If no extended RAM is installed, check into having some added.
Buying RAM can be less costly than replacing a worn hard drive.
The "K" value you have determined is the largest RAM disk you
can install at boot-up. It is not necessary to use every byte
of extended memory when installing a disk, and more than one
disk may be installed by adding more device statements to your
CONFIG.SYS file.
Second, modify your CONFIG.SYS file to include the size and
number of disks you want installed:
MS-DOS 4.01: (This text is zipped as CONFIG.MS4)
files=24
buffers=32
device=c:\dos\ansi.sys
device=c:\dos\ramdrive.sys 3456,512,128/e
device=c:\dos\ramdrive.sys 3456,512,128/e
MS-DOS 5.00: (This text is zipped as CONFIG.MS5)
files=24
buffers=32
device=c:\dos\emm386.exe
device=c:\dos\ansi.sys
device=c:\dos\ramdrive.sys 6912,512,128/e
DR-DOS 6.00: (This text is zipped as CONFIG.DR6)
files=24
fastopen=512
?"Two Ramdisks? (Y/N)"goto emm
buffers=32
?"ANSI? (Y/N)"device=a:\ansi.sys
device=a:\vdisk.sys 6912,512,128/e
goto end
:emm
?"Include EMM? (Y/N)"device=a:\emm386.sys /f=auto /kb=7424 /bdos=auto
hidos=on
?"ANSI? (Y/N)"hidevice=a:\ansi.sys
hidevice=a:\vdisk.sys 3456,512,128/e
hidevice=a:\vdisk.sys 3456,512,128/e
hibuffers=32
:end
********************************************************************
What do the numbers and options mean after the DEVICE=RAMDRIVE.SYS
and DEVICE=VDISK.SYS statements?
The 4-digit number represents the size of the RAM disk in "K".
This number should be divisible by 64, and doesn't need to be
4 digits. The MS-DOS 4.01 RAMDRIVE is limited to 4 MEG in size.
If you wish more disks to be available, run more device statements.
The 512 represents the sector size on the disk in bytes.
The 128 means there's directory space allocated for 128 entries
in the root directory of the RAM disk. If more entries are
required, make a sub-directory.
The /e option means the disk is installled in extended memory.
Use /a to install MS-DOS Ramdrive in expanded memory.
Use /x to install DR-DOS Vdisk in expanded memory.
*******************************************************************
Where's my SHELL=C:\COMMAND.COM statement?
It's gone now. We'll copy the COMMAND.COM file to the RAM disk and
run a SET COMSPEC=D:\COMMAND.COM command in the AUTOEXEC.BAT file.
Now when the computer looks for COMMAND.COM, it will find it in the
RAM disk, making it unnecessary to access the hard drive for
internal DOS commands.
*******************************************************************
What will my AUTOEXEC.BAT look like?
Something like this: (This text is zipped as AUTOEXEC.BAT)
AUTOEXEC.BAT
REM Copy and change COMMAND.COM path - include your environment
REM setting(s) in this section.
@copy c:\command.com d:
@set comspec=d:\command.com
REM Copy your PKZIP/UNZIP files to RAM disk - copy or unzip any
REM favorite utilities, editor, or DOS externals in this section.
@copy c:\pk*.exe d:
@copy c:\dos\more.com d:
REM Include the RAM disk(s) in PATH statement
@set path=d:\;c:\;c:\dos\
REM The Requisite
@prompt $p$g
@c:\mouse
REM Type out your ANSI escape sequence file and clear the screen
@type c:\pkey.txt
@cls
REM Change current directory to RAM disk
@d:
*****************************************************************
I don't use some programs which require special environment
settings at every session. Should I include those settings
in the AUTOEXEC.BAT file?
You may want to add any additional environment settings relevant
to the software you seldom use in a separate SET-UP/UNZIP/START
batch file: (This text is zipped as DATACOM.BAT)
C:\DATACOM.BAT
@set bitcom=d:\bitcom
@set bitfax=d:\bitfax
@set recvfax=d:\recvfax
@set path=d:\;d:\bitcom\;d:\bitfax\;c:\;c:\dos
@pkunzip -d c:\zip\datacom d:
@md d:\recvfax
@cd\
@d:
@comshell
It will be necessary to ZIP your DATACOM files into recursed
sub-directories using the (F4) PKZIP -RPEX keystroke command.
It may be more convenient to copy these files into an empty
RAM disk before zipping.
After copying this .BAT to the root directory of your boot drive,
typing "DATACOM" will set-up the environment, unzip the program
into recursed sub-directories on the RAM disk, make a receive fax
directory, switch the current directory to the RAM disk, and start
the program.
Note these settings will stay in effect until the next environment
adjustments are made or until the computer is turned off or reset.
********************************************************************
What are all these "@" characters preceding the .BAT commands?
They're suppressing the display of commands when run. If you want
visual feedback from these .BAT files, delete these characters.
********************************************************************
Now I can put my applications in the RAM disk?
Just copy or unzip any and all applications you intend to use at
one session into the RAM disk(s). For example, you can unzip your
CAD program into drive D: and use drive E: for drawing files.
You'll notice far less hard drive accesses, and improved speed.
Note how fast EXDB (the EXEC-PC database) runs now.
Possible viruses are now quarantined away from your storage disk(s).
********************************************************************
Are there any limitations DOS-wise with a RAM disk?
You can run any normal DOS commands on the files in a RAM disk.
Do not attempt to run a CHKDSK command there. The medium isn't
appropriate to the function. A disk optimizer will work, though.
********************************************************************
My computer can boot from drive A: into the 640K system RAM.
Do I really need a hard disk? Or a RAM disk for that matter?
No. Analyze your requirements and specify your options accordingly.
********************************************************************
I noticed you use an alias... are you a criminal or a schizo?
You could ask if you were neither?
********************************************************************
"And the ass saw the angel..." -- Numbers 22:23
"And when the ass saw the angel..." -- Numbers 22:25
*********************************************************************
I hope this upload has been some assistance to you. The techniques
outlined here have greatly increased the ease with which I use my
computer and trust you will also benefit from them.
--PINKY (Frequent Flyer)